using System;
using System.Collections.Generic;
using System.IO;

namespace ParasiTracer
{
    internal sealed class SafeDirectory
    {
        static SafeDirectory _inst = new SafeDirectory();
        static SafeDirectory() { }
        public static SafeDirectory inst { get { return _inst; } }

        public string getCurrent()
        {
            return System.IO.Path.GetDirectoryName (
                    System.Reflection.Assembly.GetExecutingAssembly()
                        .GetModules()[0].FullyQualifiedName
                );
        }

        SafeDirectory ()
        {
            System.IO.Directory.SetCurrentDirectory(
                System.IO.Path.GetDirectoryName(
                    System.Reflection.Assembly.
                        GetExecutingAssembly().GetModules()[0]
                            .FullyQualifiedName));
        }
    }
}
